package trans.model;

import java.util.LinkedHashSet;
import java.util.Set;

import trans.model.base.BaseUser;
import trans.support.Constants;



public class User extends BaseUser {
	public static final long serialVersionUID = 1L;
	
	private Set<UserTips> userTipSet = new LinkedHashSet<UserTips>();
	
	public Set<UserTips> getUserTipSet() {
		for(UserTips each : this.getUserTips()){
			userTipSet.add(each);
		}
		return userTipSet;
	}
	
	private long needHandSa;
	private long handedSa;

	public long getNeedHandSa() {
		return needHandSa;
	}

	public void setNeedHandSa(long needHandSa) {
		this.needHandSa = needHandSa;
	}

	public long getHandedSa() {
		return handedSa;
	}

	public void setHandedSa(long handedSa) {
		this.handedSa = handedSa;
	}

	public String getRoleName(){
		return Constants.USER_ROLES.get(this.getUserRole());
	}
	
	public boolean getIsCustomer(){
		return this.getUserRole() == Constants.ROLE_CUSTOMER;
	}
	
	public boolean getIsRoot(){
		return this.getUserRole() == Constants.ROLE_ADMIN;
	}

/*[CONSTRUCTOR MARKER BEGIN]*/
	public User () {
		super();
	}

	/**
	 * Constructor for primary key
	 */
	public User (java.lang.Integer id) {
		super(id);
	}

/*[CONSTRUCTOR MARKER END]*/


}